﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Sunny.UI;
namespace OtherDevice
{
    public partial class Form_Plasma : Form_ControlBase
    {
        public Form_Plasma()
        {
            InitializeComponent();
        }
        Plasma_Base plasma = null;
        public override void FlushToDlg(object devicebase)
        {
            try
            {
                if (devicebase == null)
                    return;
                this.plasma = devicebase as Plasma_Base;
                this.Dock = DockStyle.Fill;
                this.Show();
            }
            catch (Exception)
            {

            }
        }
        private void btn_Open_Click(object sender, EventArgs e)
        {
            plasma.OpenPlasma();
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            plasma.ClosePlasma();

        }

        private void btn_Reset_Click(object sender, EventArgs e)
        {
           // plasma.AirEnablePlasma();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //plasma.DisAirEnablePlasma();
        }

        private void 检测Plasma能量_Click(object sender, EventArgs e)
        {
            int n = 0;
           plasma.Fucntion_GetPlasma功率(ref n);
            MessageBox.Show(n.ToString());

        }

        private void btn_SetPlasma_Click(object sender, EventArgs e)
        {
            int nValue = 0;
            if(UIInputDialog.InputIntegerDialog(this,ref nValue))
            {
                plasma.Function_SetPlasma功率(nValue);
            }
        }
    }
}
